UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = '4AFaBAh/hRALLXcb6AUKkXB8Pz6FeI0JH5umPrKwlMU=' 
WHERE 
  key_id = '368f1824869c54372b93020af22ae12d49f23f4bc67c83dcaf8b94f27ad226f9' 
  AND (
    token = '4AFaBAh/hRALLXcb6AUKkXB8Pz6FeI0JH5umPrKwlMU=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00031