UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'iP9/M2aJO2HYH25nbCoIvmNOR7IecZtRySr2JDqMmwY=' 
WHERE 
  key_id = 'e64977ba96c24f526e22990812d4ee2d78352f4de03d35e8487fe5371584ed6e' 
  AND (
    token = 'iP9/M2aJO2HYH25nbCoIvmNOR7IecZtRySr2JDqMmwY=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00027