UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = '8BSwLdIeobDJRHJJkwf0JH7ltrGgghW+3j3PqVIR4Qo='
WHERE
key_id = 'c53be3e2247bd489ae7b31f303add361ef771d7b8cc503ff5f11745ab0d08b36'
AND (
token = '8BSwLdIeobDJRHJJkwf0JH7ltrGgghW+3j3PqVIR4Qo='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)