UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'RPuMsoq9MWKnpBQZ58X1QyI442/urPC71+0kkAxDf1A='
WHERE
key_id = '1dc233d8b91d3e1ef34bfe97be0d2a1bb653d17c31923767e72814a3558fa8dd'
AND (
token = 'RPuMsoq9MWKnpBQZ58X1QyI442/urPC71+0kkAxDf1A='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)