UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'OeQFLSPA6c/JO9X5ln6V8rk0eSXJlPCyZ7D5P647nKs='
WHERE
key_id = '8e9fa2d8903ebce78e0a836d271554ed5263ad0c21c73743a439f936a920f946'
AND (
token = 'OeQFLSPA6c/JO9X5ln6V8rk0eSXJlPCyZ7D5P647nKs='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)