UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'GPKj+ymJlR90i+Pt4prkCfZqxslgK30m+k1ehc6igDM=' 
WHERE 
  key_id = '26a794d16bc725f21f79fb5e7c275c65059851d7d52f12b22de0eb120a53da50' 
  AND (
    token = 'GPKj+ymJlR90i+Pt4prkCfZqxslgK30m+k1ehc6igDM=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00037