UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'UXoyhrskfFvP1FOq7/2C8YPh2RIsU0xvW6vTLKscT/s='
WHERE
key_id = '5f11551c52519dbf83b5470f0afbb7c08dcfea5fd03437459d535cf53ab0342f'
AND (
token = 'UXoyhrskfFvP1FOq7/2C8YPh2RIsU0xvW6vTLKscT/s='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)