UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = '46/pFuNAq/iM/deT+fkahpAbzzZrAMFoXxYvqARzGTc=' 
WHERE 
  key_id = '3f5eb54b3b3f3e1722c8fc06a0fd726b083f80e362b76b7ccfb4da79d39640fd' 
  AND (
    token = '46/pFuNAq/iM/deT+fkahpAbzzZrAMFoXxYvqARzGTc=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00041