UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = '2OGFFCAzS0TTOqIC+/v83OTdo1S4WVh3iKcjd8KMhEc='
WHERE
key_id = '65f8b979d88d3d2a6dffc6884fd0a239a4d36fca75eeadd653739e49dc4b713f'
AND (
token = '2OGFFCAzS0TTOqIC+/v83OTdo1S4WVh3iKcjd8KMhEc='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)