UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'ZG8c3xrzT+t2bEtQnrqVQD9exJMGNl8DQFDQwwH6xXw='
WHERE
key_id = '240c02ae051ef816c5d8a77e7c91766ab961cecaef4424afc901da620fdb96c3'
AND (
token = 'ZG8c3xrzT+t2bEtQnrqVQD9exJMGNl8DQFDQwwH6xXw='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)