UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'jnDkMszmfqtuSnSJvhEXBnHA/oGR+49MKocEIqTFVJY=' 
WHERE 
  key_id = 'a2d741d0ea17d560cc21105a1fecbad24f36e4ff72125061360608848f88d33a' 
  AND (
    token = 'jnDkMszmfqtuSnSJvhEXBnHA/oGR+49MKocEIqTFVJY=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00033