UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = '5E/EZw+0GjKcC974MyrMFcRjzk7cnJ/ytNoZl5nsqbY='
WHERE
key_id = '49da00b1dde0531ef0998678280994d531ac0bfa05d68c1b52263e3e87a8a816'
AND (
token = '5E/EZw+0GjKcC974MyrMFcRjzk7cnJ/ytNoZl5nsqbY='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)