UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'qr/79DY3P9/0fslEGpCp4qh//F0Yo1rSQFWIRfiFT3Q='
WHERE
key_id = '7b21d596ca2d9ba81b8158f431262cda9b930f697ae810689e124cda7344c7e3'
AND (
token = 'qr/79DY3P9/0fslEGpCp4qh//F0Yo1rSQFWIRfiFT3Q='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)