UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'Mk/0PEAFWZXF1Nj31rAEEJ7zDRxy4+7+YYYLBiKsQK8=' 
WHERE 
  key_id = 'a657b48c2fe96e56fe10e7e493c0472b8ab20b098f67e01a99f0a71a4ffb4f80' 
  AND (
    token = 'Mk/0PEAFWZXF1Nj31rAEEJ7zDRxy4+7+YYYLBiKsQK8=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00023