UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'Ozf27oDOiA1LkDpXOxb/7jJqqDY/diZ91cpG2bhdbD0='
WHERE
key_id = '5249ff1a746fc42a36bbdf58b287021efdf1de13609dae1d19b8d24b90308f4f'
AND (
token = 'Ozf27oDOiA1LkDpXOxb/7jJqqDY/diZ91cpG2bhdbD0='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)