UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'nQZkPHrt/FfvGUkyj6CJ6YeGhPZ2KO3pVD68tNCB4bA=' 
WHERE 
  key_id = 'e5caf84bb32e4dc7fc942c440888b5e06823e7e4d4ed9d7a294150e30ec9b06a' 
  AND (
    token = 'nQZkPHrt/FfvGUkyj6CJ6YeGhPZ2KO3pVD68tNCB4bA=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00046