UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'iWfKXcgALI4P/hxq6Gf78sys8dc2Iflu8E9nUzcp0vU=' 
WHERE 
  key_id = '68e8ff96d6c1336a3c71c30bdc9211e60a4ad015e005fab2ec68c0554d42085a' 
  AND (
    token = 'iWfKXcgALI4P/hxq6Gf78sys8dc2Iflu8E9nUzcp0vU=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00053