UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'jSZRln8bepcIJpHODvZLOblGs5h4wvy2S35iekJKp4c='
WHERE
key_id = '3e697ce0d5ff32319e569ee077b88298f8c4aafe75991c6638d9171fdc0b8aea'
AND (
token = 'jSZRln8bepcIJpHODvZLOblGs5h4wvy2S35iekJKp4c='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)