UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'FHTH12VNj7p7MMZRnSs3yFOXf3kzXcm0PgvdV3a+sAU=' 
WHERE 
  key_id = 'a48d4bed5419a59369ddb5fae66a1d0782d6b9aa564971b5714a75bfb6ae23de' 
  AND (
    token = 'FHTH12VNj7p7MMZRnSs3yFOXf3kzXcm0PgvdV3a+sAU=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00043