UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'yHiaONXNsIxR3T5QHwkTJgXgfqtGCX71L/DJwys3Q5E='
WHERE
key_id = '56d5cb7474e9a9742347f206dae69a3dc56926b3ec008e6759a162b83e56f93f'
AND (
token = 'yHiaONXNsIxR3T5QHwkTJgXgfqtGCX71L/DJwys3Q5E='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)