UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'iGUtlVO1H7JQHxnTTM87VSJymbjee3Wd/S8V6jxol4E='
WHERE
key_id = 'b7d9b3f7dbce3a9af1058a306ebfd895a6bad113c528d015f4581574e6e45aa9'
AND (
token = 'iGUtlVO1H7JQHxnTTM87VSJymbjee3Wd/S8V6jxol4E='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)