UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = '5x/2/BlhpUACXMj/csk5aTthy++OoCTQuaNy9379tds=' 
WHERE 
  key_id = '99fb0f0ec66cb91c6ba69f5c6102ec7643ccd2bd24bba27e1a43ec86dc865bf3' 
  AND (
    token = '5x/2/BlhpUACXMj/csk5aTthy++OoCTQuaNy9379tds=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00035