UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = '3O4Ga3bkl9c1E8KZ9dgz2N6r/loiH2ZkRSvQXYPdTWc=' 
WHERE 
  key_id = '88058665ab7c14df769faa87662f543adfb40554395f06b4d04c6040f4b7889b' 
  AND (
    token = '3O4Ga3bkl9c1E8KZ9dgz2N6r/loiH2ZkRSvQXYPdTWc=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00031