UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = '/blqfx7MqJ7PPOpOAxNZ2AjVFKX/HOz7u46pzmdXVEk=' 
WHERE 
  key_id = '84d4d9da7ee328f9205015764b6c74d8ff7ecf3aeecbc7b58b7ca2cbc8b93ebd' 
  AND (
    token = '/blqfx7MqJ7PPOpOAxNZ2AjVFKX/HOz7u46pzmdXVEk=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00030