UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'Z8AfiUu6Sr1AEf3ruGX+n9aLR0BcPU3Iit//6FhMGT0='
WHERE
key_id = '1c876ec45781a49b3ae0b640ee5e1178cdf17a0453bf09880beae973fed0f321'
AND (
token = 'Z8AfiUu6Sr1AEf3ruGX+n9aLR0BcPU3Iit//6FhMGT0='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)