UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'MQHFbdaLmB+RQM3VqgKYsbjDKTiX+BuZav+uuFRgQQw='
WHERE
key_id = '7cab5f6da112cc84811b999ecf88fd5d496d5ed7ab4a6240ca111283843094f8'
AND (
token = 'MQHFbdaLmB+RQM3VqgKYsbjDKTiX+BuZav+uuFRgQQw='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)