UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = '8+efrBYy0g7b9XOfA2JPnS3676O6WD6FwnWyP0NrrcE='
WHERE
key_id = '4fad781d06416ae79d6574646af676ef80ef3dca12cae7490e14e4dee5254bd2'
AND (
token = '8+efrBYy0g7b9XOfA2JPnS3676O6WD6FwnWyP0NrrcE='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)