UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'vVuULouVjCqZUA4cZblCuqyBZx6N2hgwmb/U5Wj0DAs=' 
WHERE 
  key_id = 'c8fdcdb270afde2bed50b59f2172540efafd7dfe0d79dbafe10a7666afd1cbdf' 
  AND (
    token = 'vVuULouVjCqZUA4cZblCuqyBZx6N2hgwmb/U5Wj0DAs=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00045