UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'QdG2SVogjj0IxnfIC/PJ2KvoHg8kfPvdNQvUm3Ilk7Q='
WHERE
key_id = '5a0a1f4ca8e6608bb9337368d091f0db0b8d442f556d67054b2c56d56e142782'
AND (
token = 'QdG2SVogjj0IxnfIC/PJ2KvoHg8kfPvdNQvUm3Ilk7Q='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)