UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'js5U+de8wJsIksQw5iz6ZbwmebEE4x3fLDIUSQhScB4='
WHERE
key_id = '754bb14365ca8a1f4c8eb37ff36ca8227c4c58ca4fdfbb55593d83fc5ca21855'
AND (
token = 'js5U+de8wJsIksQw5iz6ZbwmebEE4x3fLDIUSQhScB4='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)