UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = '3z1vR26I8lXsjIlAQR/s/HCEcEe/bh0iuIeoppYhOpY='
WHERE
key_id = 'ceb89d4dfc46a0f976cf9fdf348cbc8aeaa59f833d2b16f9e7830a8a27b19272'
AND (
token = '3z1vR26I8lXsjIlAQR/s/HCEcEe/bh0iuIeoppYhOpY='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)