UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'EWzpRJDFaj1/wb2BLGzWj+7cGH0XV+uHts1UzAjQ3fw='
WHERE
key_id = 'd6badbdab7e33f0f32394dc7d294a7a2aec038a75fb60a6d2e724efe3ba63bfb'
AND (
token = 'EWzpRJDFaj1/wb2BLGzWj+7cGH0XV+uHts1UzAjQ3fw='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)