UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'kFJzIWwSP3W8o1/d4PApalme7124EIuKPevhHjxhVyQ=' 
WHERE 
  key_id = 'ccf5f5920740278c9d0f87f1c2be28b4bb84b5ef0a39167cf7cdf83e8eefaf84' 
  AND (
    token = 'kFJzIWwSP3W8o1/d4PApalme7124EIuKPevhHjxhVyQ=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00028