UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'PQujMUNkHg+Fw+uwP/4erTt+rtYxu4NTU3F7E19CivQ=' 
WHERE 
  key_id = 'e08deed37087db28941766602559469e7867ca9a41b705001fa7587e07799571' 
  AND (
    token = 'PQujMUNkHg+Fw+uwP/4erTt+rtYxu4NTU3F7E19CivQ=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00040