UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'QOGwSDiARo+LdCO66LcK8x/13DqSpHiu+6oIT1KHWeY='
WHERE
key_id = '8362ec528f7b6ee05c10c45e7f5056e40f454f53ac3054ef13d5cf6b14454b3a'
AND (
token = 'QOGwSDiARo+LdCO66LcK8x/13DqSpHiu+6oIT1KHWeY='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)