UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'j9bYWoPxRCmQV55Hfdx5ckiMhFkYGDk5b6SO6cCY50U=' 
WHERE 
  key_id = '60337f2b98e8d3903841e112b64dfc63d7a729bc52825bab1990052ae302f18a' 
  AND (
    token = 'j9bYWoPxRCmQV55Hfdx5ckiMhFkYGDk5b6SO6cCY50U=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00035