UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'xap/YAgrFDX/UazYrQOmi7MHZT7GVAiTGB5YP57uuUk=' 
WHERE 
  key_id = 'f9ddad1715e9d5c1cb63fd34c168dfbd49096ed1dce94439625db5c48a519666' 
  AND (
    token = 'xap/YAgrFDX/UazYrQOmi7MHZT7GVAiTGB5YP57uuUk=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00055