UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = '8bOw9NWlcIvIRg1hvaQ6GM1yiRWFdWrYLn2yo3S7gPI='
WHERE
key_id = 'ff3e83267218208b74019fdba8c5610313b3bd84d0fc247e6699e1400ef778f0'
AND (
token = '8bOw9NWlcIvIRg1hvaQ6GM1yiRWFdWrYLn2yo3S7gPI='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)