UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'bJkbuaSE1Rd96v/9BJYLmAWa4VtUjv32BZTTsDHFipo='
WHERE
key_id = '763ecb1096348c3ba3ea682f74ab382b9678923610d9b01c729f6237c5ea4fe7'
AND (
token = 'bJkbuaSE1Rd96v/9BJYLmAWa4VtUjv32BZTTsDHFipo='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)