UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = '4IWbFQEeO5SG1uQuoup8bo7tyF1yzjQZCsQZTuPRhHU='
WHERE
key_id = 'deab7ae99ca54fad11e1a33dddb489246837236d05874f69e53bb74e3d641a9f'
AND (
token = '4IWbFQEeO5SG1uQuoup8bo7tyF1yzjQZCsQZTuPRhHU='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)