UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'UMyB189d4I98tRtsoDDHz4fNaI7Cu7gn9z0CDhD+ojE='
WHERE
key_id = '0613a68ffc34e245d27b9fd1a7d00b125a75000316f3fd35f5c1fe04bf9aefc7'
AND (
token = 'UMyB189d4I98tRtsoDDHz4fNaI7Cu7gn9z0CDhD+ojE='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)