UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'lUx1oFT663KEtqFHPPqa+pkh7tBI11sJVxiU8rLf5bU='
WHERE
key_id = 'fc6a43c53080f9491bfedfba5677aaad602bf29a093d0aa4074fb28fa2c7e15f'
AND (
token = 'lUx1oFT663KEtqFHPPqa+pkh7tBI11sJVxiU8rLf5bU='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)